import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
 import {saveStore} from '@/utils/util'
// 用来存储数据
const state = {
   decadetype:[],
   grouptype:[],
   localtype:[],
   relics:[],
   StatesortParams:{
    groupType:'0',
    decadeType:'0',
    localType:'0',
   }
}
// 操作数据
const mutations = {
  SET_SORTPARAMS(state,payload){
    state.StatesortParams=payload
    saveStore()
  },
  SET_RELICS(state,payload){
    state.relics=payload
    saveStore()
  },
   SET_DECADETYPE(state,payload){
     state.decadetype=payload
     saveStore()
   },
   SET_GROUPTYPE(state,payload){
    state.grouptype=payload
    saveStore()
  },
  SET_LOCALTYPE(state,payload){
    state.localtype=payload
    saveStore()
  },
}
// 新建并暴露store
export default {
    namespaced:true,
    state,
    mutations,
}
 